// components/animationBall/animationBall.ts
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    showBall: {
      type: Boolean,
      value: false
    },
    position: {
      type: Object,
      value: {}
    }
  },
  data:{
    style:""
  },

  observers: {
    "position.startX, position.startY": function (startX, startY) {
      // console.log(startX,startY)
   
      let style = `--startX:${startX}px;--startY:${startY}px;--endX: 15vw;--endY: 92vh`;
      // let style = `--startX:${startX}px;--startY:${startY}px;--endX: 51.578125px;--endY: 683.375px`;
       
      this.setData({
        style
      });
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    watchAnimation(res) {
      console.log('end',res)
      if (res?.detail?.animationName === "showAndHide") {
        this.triggerEvent("animationHasDone");
      }
    }
  }
})